package springboot.demo.controller;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import org.springframework.web.bind.annotation.*;

import springboot.demo.dto.RequestDto;
import springboot.demo.dto.ResultDTO;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

@RestController
@RequestMapping("simple")
public class SimpleController {

	private static Logger LOGGER = LoggerFactory.getLogger(SimpleController.class);

    @GetMapping("/v1/testhello")
    public ResultDTO testhello(HttpServletRequest request, HttpServletResponse response, String helloparam) {
        LOGGER.info("testhello:{}", helloparam);

        return ResultDTO.success("hello");
    }

	@PostMapping("/v1/testbody")
	public ResultDTO testbody(@RequestBody RequestDto body) {
		LOGGER.info("testbody:{}", body.getParam());
		return ResultDTO.success("get body");
	}


}
